package hk.linkcredit.walletservice.wallet.controller;

import hk.linkcredit.walletservice.constant.Status;
import hk.linkcredit.walletservice.exception.JsonException;
import hk.linkcredit.walletservice.exception.PageException;
import hk.linkcredit.walletservice.model.Result;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * <p>
 * 测试Controller
 * </p>
 *
 * @author yangkai.shen
 * @date Created in 2018-10-02 20:49
 */
@RestController
public class TestController {

    @GetMapping("/json")
    @ResponseBody
    public Result jsonException() {
        throw new JsonException(Status.UNKNOWN_ERROR);
    }

    @GetMapping("/page")
    public ModelAndView pageException() {
        throw new PageException(Status.UNKNOWN_ERROR);
    }
}
